{{include file="public/header" /}}

<!-- right content start  -->
<div class="content-right">
	<div class="content">
		<!-- form start -->
		<form class="am-form form-validation am-form-full-screen am-form-popup-fixed" action="{{:MyUrl('admin/slide/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/slide/index', $params)}}" enctype="multipart/form-data">
			<legend>
				<span class="am-text-default">{{:MyLang('slide.base_nav_title')}}{{if empty($data['id'])}}{{:MyLang('created_title')}}{{else /}}{{:MyLang('edit_title')}}{{/if}}</span>
				<a href="{{:MyUrl('admin/slide/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> {{:MyLang('retreat_title')}}</a>
			</legend>

			<div class="am-cf">
        		<div class="am-u-sm-6 am-padding-horizontal-0">
        			<div class="am-form-group">
						<label>{{:MyLang('common_service.slide.form_item_name')}}<span class="am-form-group-label-tips-must">*</span></label>
						<input type="text" name="name" placeholder="{{:MyLang('common_service.slide.form_item_name_message')}}" minlength="2" maxlength="60" data-validation-message="{{:MyLang('common_service.slide.form_item_name_message')}}" class="am-radius" {{if !empty($data['name'])}} value="{{$data.name}}"{{/if}} required />
					</div>
        		</div>
        		<div class="am-u-sm-6 am-padding-horizontal-0">
        			<div class="am-form-group">
						<label>{{:MyLang('form_platform_title')}}<span class="am-form-group-label-tips-must">*</span></label>
						<select name="platform" class="am-radius chosen-select" data-placeholder="{{:MyLang('optional_tips')}}" data-validation-message="{{:MyLang('form_platform_message')}}" required>
							<option value="">{{:MyLang('optional_tips')}}</option>
							{{foreach :MyConst('common_platform_type') as $v}}
								<option value="{{$v.value}}" {{if isset($data['platform']) and $data['platform'] eq $v['value']}}selected{{else /}}{{if !isset($data['platform']) and isset($v['checked']) and $v['checked'] eq true}}selected{{/if}}{{/if}}>{{$v.name}}</option>
							{{/foreach}}
						</select>
					</div>
        		</div>
        	</div>

        	<div class="am-cf">
        		<div class="am-u-sm-12 am-u-md-6 am-padding-horizontal-0">
        			<div class="am-form-group">
                        <label>{{:MyLang('common_service.slide.form_item_describe')}}</label>
                        <input type="text" name="describe" placeholder="{{:MyLang('common_service.slide.form_item_describe_message')}}" maxlength="230" data-validation-message="{{:MyLang('common_service.slide.form_item_describe_message')}}" class="am-radius" {{if !empty($data['describe'])}} value="{{$data.describe}}"{{/if}} />
                    </div>
        		</div>
        		<div class="am-u-sm-12 am-u-md-6 am-padding-horizontal-0">
                    <div class="am-cf">
                        <div class="am-u-sm-6 am-padding-horizontal-0">
                            <div class="am-form-group">
                                <label>{{:MyLang('form_event_type_title')}}</label>
                                <select name="event_type" class="am-radius chosen-select" data-placeholder="{{:MyLang('optional_tips')}}" data-validation-message="{{:MyLang('form_event_type_message')}}">
                                    <option value="">{{:MyLang('optional_tips')}}</option>
                                    {{foreach :MyConst('common_app_event_type') as $v}}
                                        <option value="{{$v.value}}" {{if isset($data['event_type']) and $data['event_type'] eq $v['value']}}selected{{else /}}{{if !isset($data['event_type']) and isset($v['checked']) and $v['checked'] eq true}}selected{{/if}}{{/if}}>{{$v.name}}</option>
                                    {{/foreach}}
                                </select>
                            </div>
                        </div>
                        <div class="am-u-sm-6 am-padding-horizontal-0">
                            <div class="am-form-group">
                                <label>{{:MyLang('form_bg_color_title')}}</label>
                                <input type="hidden" name="bg_color" value="{{if !empty($data['bg_color'])}}{{$data.bg_color}}{{/if}}" />
                                <button class="am-btn am-btn-default am-btn-xs colorpicker-submit bg-color-tag am-btn-block bk-cr-white t-r" type="button" data-input-tag="button.bg-color-tag" data-color-tag="input[name='bg_color']" data-color-style="background-color" {{if !empty($data)}} style="background-color:{{$data.bg_color}};"{{/if}}>
                                    <img src="{{$attachment_host}}/static/common/images/colorpicker.png" />
                                </button>
                            </div>
                        </div>
                    </div>
        		</div>
        	</div>

			<div class="am-form-group">
				<label>{{:MyLang('form_event_value_title')}}</label>
				<input type="text" name="event_value" placeholder="{{:MyLang('form_event_value_message')}}" data-validation-message="{{:MyLang('form_event_value_message')}}" class="am-radius" {{if !empty($data['event_value'])}} value="{{$data.event_value}}"{{/if}} />
				{{include file="public/event_value_tips" /}}
			</div>

			<div class="am-cf">
    			<div class="am-u-sm-4 am-u-md-6 am-padding-horizontal-0">
    				<div class="am-form-group am-form-file">
						<label class="am-block">{{:MyLang('common_service.slide.form_item_images_url')}}<span class="am-form-group-label-tips-must">*</span>{{if is_array(MyLang('common_service.slide.form_item_images_url_tips'))}}<a href="javascript:;" class="am-icon-question-circle am-text-warning am-margin-left-sm" data-am-popover="{content: '{{:implode('<br />', MyLang('common_service.slide.form_item_images_url_tips'))}}', trigger: 'hover focus', theme: 'sm'}"></a>{{/if}}</label>
						<ul class="plug-file-upload-view slide-images_url-images-view" data-form-name="images_url" data-max-number="1" data-delete="0" data-dialog-type="images">
							<li>
								<input type="text" name="images_url" value="{{if !empty($data['images_url'])}}{{$data.images_url}}{{/if}}" data-validation-message="{{:MyLang('form_upload_images_message')}}" required />
								<img src="{{if !empty($data['images_url'])}}{{$data.images_url}}{{else /}}{{$attachment_host}}/static/admin/default/images/default-images.jpg{{/if}}" />
							</li>
						</ul>
						<div class="plug-file-upload-submit" data-view-tag="ul.slide-images_url-images-view">+ {{:MyLang('form_upload_images_title')}}</div>
					</div>
    			</div>
    			<div class="am-u-sm-8 am-u-md-6 am-padding-horizontal-0">
    				<div class="am-cf">
		    			<div class="am-u-sm-12 am-padding-horizontal-0">
		    				<div class="am-form-group">
                                <label>{{:MyLang('form_time_valid_title')}}</label>
                                <div class="form-multiple-where-input">
                                    <input type="text" name="start_time" autocomplete="off" class="Wdate am-radius" placeholder="{{:MyLang('form_time_start_title')}}" data-validation-message="{{:MyLang('form_time_start_message')}}" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss', maxDate:'#F{$dp.$D(\'end-time\');}'})" {{if !empty($data['start_time'])}}value="{{$data.start_time}}"{{/if}} data-is-clearout="0" id="start-time" />
                                    <span class="am-text-grey">~</span>
                                    <input type="text" name="end_time" autocomplete="off" class="Wdate am-radius" placeholder="{{:MyLang('form_time_end_title')}}" data-validation-message="{{:MyLang('form_time_end_message')}}" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss', minDate:'#F{$dp.$D(\'start-time\');}'})" {{if !empty($data['end_time'])}}value="{{$data.end_time}}"{{/if}} data-is-clearout="0" id="end-time" />
                                </div>
                            </div>
		    			</div>
		    			<div class="am-u-sm-12 am-padding-horizontal-0">
		    				<div class="am-cf">
                                <div class="am-u-sm-6 am-padding-horizontal-0">
                                    {{include file="lib/sort" /}}
                                </div>
                                <div class="am-u-sm-6 am-padding-horizontal-0">
                                    {{include file="lib/is_enable" /}}
                                </div>
                            </div>
		    			</div>
		    		</div>
    			</div>
    		</div>

			<div class="am-form-popup-submit">
				<input type="hidden" name="id" {{if !empty($data['id'])}} value="{{$data.id}}"{{/if}} />
				<a href="{{:MyUrl('admin/slide/index', $params)}}" class="am-btn am-btn-warning am-radius am-btn-xs am-margin-right-lg">
                    <i class="am-icon-mail-reply"></i>
                    <span>{{:MyLang('retreat_title')}}</span>
                </a>
                <button type="submit" class="am-btn am-btn-primary am-radius am-btn-xs btn-loading-example" data-am-loading="{spinner: 'circle-o-notch', loadingText:'{{:MyLang('save_title')}}'}">
                    <i class="am-icon-save"></i>
                    <span>{{:MyLang('save_title')}}</span>
                </button>
			</div>
		</form>
        <!-- form end -->
	</div>
</div>
<!-- right content end  -->

<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->